import http from "@/api";

/**
 * @name 评论管理模块
 */

export const getCommentList = params => {
  return http.get(`/comment/page/byUserType`, params);
};

export const deleteComment = params => {
  return http.delete(`/comment/delete`, params);
};

export const getVisit = params => {
  return http.get(`/ip/getall`, params);
};

export const deleteVisit = params => {
  return http.delete(`/ip/delete`, params);
};

// 循环字
export const getText = params => {
  return http.get(`/text/getall`, params);
};

export const deleteText = params => {
  return http.delete(`/text/delete`, params);
};

export const addText = params => {
  return http.post(`/text/insert`, params);
};

// 链接管理
export const getLink = params => {
  return http.get(`/url/page/findby`, params);
};

export const deleteLink = params => {
  return http.delete(`/url/delete`, params);
};

export const examineLink = params => {
  return http.get(`/url/updateUrlPass`, params);
};

// 轮播图
export const getCarouseMap = () => {
  return http.get(`/carouseMap/searchCarouseMap`);
};

// 轮播图
export const updateCarouseMap = params => {
  return http.post(`/carouseMap/updateCarouseMap`, params);
};

// 用户
export const getUser = params => {
  return http.get(`/user/page/findby`, params);
};
export const updateUser = params => {
  return http.post(`/user/updateUserInfo`, params);
};
export const deleteUser = params => {
  return http.delete(`/user/delete`, params);
};

// 获取全部文章
export const getAllArticleInfo = params => {
  return http.get(`/article/showAllArticleInfo`, params);
};
// 查询系统设置
export const getSystemSetup = params => {
  return http.get(`/systemSetup/showAllSystemSetup`, params);
};
// 保存设置
export const updateSystemSetup = params => {
  return http.post(`/systemSetup/updateSystemSetup`, params);
};

// 查询分类
export const getClassifyInfo = () => {
  return http.get(`/classify/showAllClassifyInfo`);
};

// 删除分类
export const deleteClassify = params => {
  return http.delete(`/classify/delete`, params);
};

// 新增分类
export const addClassify = params => {
  return http.post(`/classify/insert`, params);
};

// 编辑分类
export const editClassify = params => {
  return http.post(`/classify/update`, params);
};

// 查询文章
export const getArticle = params => {
  return http.get(`/article/page/byUserType`, params);
};

// 删除文章
export const deleteArticle = params => {
  return http.delete(`/article/delete`, params);
};

// 新增文章
export const addArticle = params => {
  return http.post(`/article/insertArticleInfo`, params);
};
// 增加对应类型的文章数量
export const addArticleNum = params => {
  return http.get(`/comment/count`, params);
};

// 审核文章updateArticlePass
export const updateArticlePass = params => {
  return http.get(`/article/updateArticlePass`, params);
};

// 编辑文章
export const updateArticleInfo = params => {
  return http.post(`/article/updateArticleInfo`, params);
};

// 分类文章+1
export const updateArticleNumberByClassifyId = params => {
  return http.get(`/classify/updateArticleNumberByClassifyId`, params);
};

// 分类文章-1
export const updateArticleNumberByClassifyId2 = params => {
  return http.get(`/classify/updateArticleNumberByClassifyId2`, params);
};
